<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<TITLE>OnInclude Event</TITLE>
<link rel="stylesheet" type="text/css" href="help.css">
</HEAD>

<BODY BGCOLOR="#FFFFFF" TEXT="#000000">

<OBJECT TYPE="application/x-oleobject" CLASSID="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
	<PARAM NAME="Keyword" VALUE="OnInclude Event">
</OBJECT>

<H1><A NAME="oninclude_event"></A><B>OnInclude Event</B></H1>
<HR>

<H2 class="AppliesTo">Applies to</H2>

<P><A HREF="thtmlviewer_component.htm">THtmlViewer</A>, <A HREF="tframeviewer_component.htm">TFrameViewer</A>, and <A HREF="tframebrowser_component.htm">TFrameBrowser</A> components</P>

<H2 class="Declaration">Declaration</H2>

<P><B>property</B> OnInclude: <A HREF="type_tincludetype.htm">TIncludeType</A>;</P>

<H2 class="Description">Description</H2>

<P>The OnInclude event allows text to be inserted in an HTML document at load time.  Within the HTML document, the OnInclude event is generated when server side include syntax is encountered.  See the <A HREF="type_tincludetype.htm">TIncludeType</A> for more information on the parameters and on the server side include syntax.</P>

<H2 class="Example">Example</H2>

<P>The OnInclude handler below could be used to fill in the current date in an HTML document</P>

<P>procedure TForm1.DoInclude(Sender: TObject; const Command: string; Params: TStrings;</P>

<P>var S: string);</P>

<P>begin</P>

<P>if CompareText(Command, 'Date') = 0 then</P>

<P>S := DateToStr(Date)</P>

<P>Params.Free;</P>

<P>end;</P>

<P>In the HTML document, the following would be replaced in its entirety by the generated string.</P>

<P>&lt;!--#date --&gt;</P>

</BODY>
</HTML>
